package com.njit.mailm.core.dao;

import com.njit.mailm.core.bean.Classify;
import com.njit.mailm.core.bean.Email;
import com.njit.mailm.core.bean.MessageWrap;
import com.njit.mailm.core.bean.User;

import java.util.List;

/**
 * Created by Administrator on 2016/5/10.
 */
public interface ClassifyDao {

    /**
     * 通过用户Id获取其的所有邮箱对象
     * @param userid
     * @return
     */
    List<Email> getAllEmailByUserId(String userid);

    /**
     * 获得所有的未读邮件
     * @param emails
     * @return
     */
    List<MessageWrap> getAllUnreadMessage(List<Email> emails);

    /**
     *
     * @param id
     * @return
     */
    MessageWrap getMessageById(String id);

    List<MessageWrap> getAllStarMessage(String id);

    List<MessageWrap> showAllMessage(String id);

    Classify getClassifyByName(String name, User user);

    void addMessage2Classify(Classify classify, MessageWrap message) throws Exception;

    List<MessageWrap> getMessageInClassify(Classify classify);
}
